from PIL import Image

image = Image.open("tank.png")

image.save("tank.ico", format="ICO")

image = Image.open("tank.ico")
image.save("tank.ico")
